<?php 

error_reporting(0);
date_default_timezone_set("Asia/Shanghai");
header("content-Type: text/html; charset=utf-8");
$doup2s = "./inc/desc.txt";

$tiaojian1="手机";			
$UpDir="data3";			
$ismas="0";	

$file_qd_ok = "inc/qd_ok.txt"; //存放已签到名单
$file_qd_all = "inc/qd_all.txt"; //存放所有名单用于对比
$file_qd_time = "inc/time.txt"; //存放签到时间
$password = "ffep2019"; //后台管理的密码
/* 自定义提示函数 */
function echomsg($tishiTitle,$code=1,$tishiMsg){
    $ico_css = $code==1 ? "icon-success" : "icon-warn";
    $msg_html='
     <div class="page-content-msg on">
      <div class="top-ico"><i class="iconfont '.$ico_css.'"></i></div>
      <div class="msg-box-txt">
          <h4>'.$tishiTitle.'</h4>
          <p>'.$tishiMsg.'</p>
      </div>
      
    </div>
    ';
    echo $msg_html;
}

function webalert($Key){
 $html="<script>\r\n";
 $html.="alert('".$Key."');\r\n";
 $html.="history.back(-1);\r\n";
 $html.="</script>";
 exit($html);
}


function traverse($dir_name = '.') {
$dir = opendir($dir_name); 
$basename = basename($dir_name); 
$fileArr = array(); 
while ($file_name = readdir($dir)) 
{ 
if (($file_name ==".") || ($file_name == "..")) { 
 } else if(is_dir($file_name)) {
 } else {
$filetp=substr($file_name,-4);
$filetp=strtolower($filetp);
$filesw=substr($file_name,0,-4);//注意后缀是4位数
if($filetp == ".txt"){
$file = $filesw;    //
echo '<option value="'.trim($file).'">' . trim($file) . '</option>';
} 
 } 
} 
closedir($dir); 
} 

function fileline1($path = '.') {
   $a_content = file_get_contents($path);
   $str = strtok($a_content,"\r");
   return $str;
}



function get_file_line( $file_name, $line ){
  $n = 0;
  $handle = fopen($file_name,'r');
  if ($handle) {
    while (!feof($handle)) {
        ++$n;
        $out = fgets($handle, 4096);
        if($line==$n) break;
    }
    fclose($handle);
  }
  if( $line==$n) return $out;
  return false;
}
?>